package test13;

import java.io.*;
import java.net.*;
import java.util.*;

public class Client201521123067 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str=sc.next();
		int num=sc.nextInt();
		try {
			Socket s = new Socket(str, num);
			try {
				InputStream inStream = s.getInputStream();
				Scanner in = new Scanner(inStream);

				while (in.hasNextLine()) {
					String line = in.nextLine();
					System.out.println(line);
				}
			} finally {
				s.close();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
